/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaces;

import entities.Address;
import javax.ejb.EJBException;
import javax.ejb.Local;

/**
 * EJB for Address entity
 *
 * @author Thibault
 */
@Local
public interface AddressInterface {

    /**
     * Add a new address in database.
     *
     * @param address the address to add at database.
     */
    public void createAddress(Address address);

    /**
     * Find an Address using his identifiant
     *
     * @param id id of searching address.
     * @throws EJBException if address doesn't exist.
     * @return The address corresponding to id, throws <b>EJBException</b> if
     * doesn't exist.
     */
    public Address findById(long id) throws EJBException;

    /**
     * Delete an address from database.
     *
     * @throws EJBException if address id doesn't exist.
     * @param id Identifiant of address to delete.
     */
    public void removeAdress(long id) throws EJBException;

    /**
     * Update an address from database.
     *
     * @param address the address to update.
     */
    public void updateAdress(Address address);
}
